@extends('admin.base')

@section('content')
    <div class="layui-card">
        <div class="layui-card-header layuiadmin-card-header-auto">
            <h2>用户详情</h2>
        </div>
        <div class="layui-card-body">
            <form class="layui-form" action="" method="post">
                @include('admin.user._form')
            </form>
        </div>
    </div>
@endsection

@section('script')
    <script>
        layui.use(['layer', 'table','element'], function () {
            var $ = layui.jquery;
            var layer = layui.layer;
            var table = layui.table;
            var element = layui.element;
            //用户一级好友表格初始化
            var dataTable = table.render({
                elem: '#dataTable'
                , height: 'auto'
                , width: 900
                , url: "{{ route('user.one_friends') . '?id=' . $user->id}}"
                , page: true //开启分页
                , cols: [[ //表头
                      {field: 'mobile', title: '手机号'}
                    , {field: 'username', title: '用户名'}
                    , {field: 'nickname', title: '微信昵称'}
                    , {field: 'openid', title: '微信id'}
                    , {field: 'created_at', title: '注册时间'}
                ]]
            });

            //用户二级好友表格初始化
            var dataTable = table.render({
                elem: '#dataTable2'
                , height: 'auto'
                , width: 900
                , url: "{{ route('user.two_friends') . '?id=' . $user->id}}"
                , page: true //开启分页
                , limit: 1
                , cols: [[ //表头
                    {field: 'mobile', title: '手机号'}
                    , {field: 'username', title: '用户名'}
                    , {field: 'nickname', title: '微信昵称'}
                    , {field: 'openid', title: '微信id'}
                    , {field: 'created_at', title: '注册时间'}
                ]]
            });
        })
    </script>
@endsection

